home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GTLNSTNG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  949 b   |  39 lines

  1. /* getlinesettings */
  2.  
  3. #include <stdio.h>
  4. #include <graphics.h>
  5. /* Define the pattern names */
  6.  
  7. char *patname[]=
  8. {"Solid","Dotted","Centered","Dashed","User defined patter"};
  9.  
  10. main()
  11. {
  12.     int graphdriver = DETECT,graphmode;
  13.     struct linesettingstype lsettings;
  14.     char buffer[80];
  15.  
  16. /*  Initialize the graphics system */
  17.  
  18.     initgraph(&graphdriver,&graphmode,"c:\\turboc");
  19.     outtextxy(10,20,"Demonstrating getlinesettings");
  20.  
  21. /*  Get current line settings and dscribe them */
  22.  
  23.     getlinesettings(&lsettings);
  24.     sprintf(buffer,
  25.         "Line style is %s, %d pixels wide",
  26.         patname[lsettings.linestyle],
  27.         lsettings.thickness);
  28.     outtextxy(10,60,buffer);
  29.     sprintf(buffer,"Current line pattern is: %x",
  30.         lsettings.upattern);
  31.     outtextxy(10,70,buffer);
  32.     outtextxy(10,90,"Here's how it looks");
  33.     line(10,100,210,100);
  34. /*  Give user a chance to see the result */
  35.     outtextxy(10,220,"Hit any key to exit:");
  36.     getch();
  37.     closegraph();
  38. }
  39.